home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / prog_c / cuj0696.zip / DWYER.ZIP / SERIAL.TST / README.SRL < prev    next >
Text File  |  1995-12-27  |  4KB  |  120 lines

  1.  
  2. DESCRIPTION OF THE SERIAL TEST
  3.  
  4. Introduction
  5. ------------
  6.  
  7. The serial test is a lot like the frequency test.  The similarity
  8. is that all pairs occur with the same probability.  The difference
  9. is that you grind out independent PAIRS of random numbers to see
  10. how uniformly the pairs are distributed.  The probability of an
  11. occurrence of a pair of integers (q,r) in a collection of pairs,
  12. where 0 <= q,r < d, is 1/d^2.  The number of times that each pair
  13. occurs is counted and a chi-square test is performed when the
  14. count is complete.  The number of pairs to be counted must be
  15. at least 5 * d^2 (the program will insist on it).
  16.  
  17. The serial test is implemented as program serltst.  This program
  18. performs a Kolmogorov-Smirnov analysis on probabilities from 100
  19. chi-square tests.  The parameters that determine how the chi-square
  20. tests are performed are specified by the user.  These parameters
  21. are read from the console unless the input device is redirected.
  22. As usual, prompts and messages are written to stderr and results
  23. are written to stdout.
  24.  
  25.  
  26. Running the Serial Test
  27. -----------------------
  28.  
  29. To start program serltst, you can say simply
  30.  
  31.     serltst
  32.  
  33. and you will be prompted for the required inputs.
  34.  
  35. Alternatively, you can say
  36.  
  37.     serltst < [myserl.inp]
  38.  
  39. and the program will take its input data from myserl.inp.
  40.  
  41. Five parameters will be requested by program serltst:
  42.  
  43.     1.     Seed for the random number generator (-1 = Time of day).
  44.  
  45.            If you do not specify -1, the value entered must be less
  46.     than 65536.
  47.  
  48.     2.    Selection of generator to be tested.
  49.  
  50.         If you are working interactively, you will see a list
  51.            of the generators that can be selected.  You enter the
  52.     character that represents your generator.  If you enter
  53.     a character that is not in the list, the library rand()
  54.     function will be used.
  55.  
  56.     3.    Size of data set.
  57.  
  58.     You can specify any number between 10 (a lower limit set in
  59.     the program) and 181 which is the nearest integer less than
  60.     the square root if 32768.
  61.  
  62.     Independent pairs of random integers between 0 and one less
  63.     than the number that you specify here will be generated.
  64.  
  65.     4.    Minimum cell expectation.
  66.  
  67.     A cell is the same as a category and a category is represented
  68.     by an independent pair of random numbers.  The number entered
  69.     here sets the minimum number of random pairs that you can specify
  70.     in the next input.  The minimum number of pairs is
  71.  
  72.         M = S * S * E
  73.  
  74.     where S is specified at step 3 and E is specified here.
  75.  
  76.     5.    Number of pairs of random numbers to be generated.
  77.  
  78.     If you do not enter a number less than the minimum number
  79.     dictated by parameter 4, the minimum number will be used.
  80.     The program will tell you that your entry has been clamped
  81.     if this happens.
  82.  
  83. Once the input parameters are out of the way, the program will execute
  84. 100 chi-square runs as dictated by the input:
  85.  
  86.     1.    The generator of choice is called 2*M times and the cell
  87.     (or category) corresponding to the integer pair is tallied.
  88.  
  89.     2.  A chi-square statistic is calculated for the array of tallies.
  90.  
  91.     3.    A probability for the chi-square statistic is calculated.
  92.  
  93.     4.    The probability is stored.
  94.  
  95.     5.    A running account of the steps and the number of variates
  96.     generated lets you know that the program is executing.
  97.  
  98. When the 100 runs are complete, a Kolmogorov-Smirnov test is run on
  99. the array to obtain statistics Kn+ and Kn- and their corresponding
  100. probabilities.
  101.  
  102. Final printouts consist of the Kolmogorov-Smirnov statistics and
  103. probabilities and the number of random numbers generated during the
  104. test.
  105.  
  106. Figure.1s shows a sample file should you elect to redirect the input.
  107. Figure.2s shows what you can expect to see if you let all outputs run
  108. to your console.  Figure.3s shows the results of a run made from the
  109. inputs shown in Figure.1s.
  110.  
  111. Timing Estimates
  112. ----------------
  113.  
  114. The run shown in figure.1p required about 1.8 seconds on my
  115. Pentium 100.  Naturally, the time required depends on the
  116. generator (and the CPU).  For the data shown, the range of
  117. times is from 1.8 seconds for the MSC library function rand()
  118. to 8.8 seconds for the generator by Stephen L. Moshier.
  119. Both tests required exactly 1,000,000 random numbers.
  120.